package com.sss.hloster0505;

import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedList;

public class TestComparable {

	public static void main(String[] args) {
		test01();
	}

	private static void test01() {
		// 用LinkdeList存储学生对象
		LinkedList stuLL = new LinkedList();
		stuLL.add(new Student("王云", 1));
		stuLL.add(new Student("南天华", 3));
		stuLL.add(new Student("刘景涛", 2));
		stuLL.add(new Student("张平", 3));
		// 使用sort方法进行排序
		Collections.sort(stuLL);
		Iterator it = stuLL.iterator();
		while (it.hasNext()) {
			System.out.println(it.next());
		}
	}
}
